/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _HANTRODEC_H_
#define _HANTRODEC_H_
#include <linux/ioctl.h>
#include <linux/types.h>
//#include "../pcidriver/hantrommu.h"


struct core_desc {
	__u32 id; /* id of the core */
	__u32 *regs; /* pointer to user registers */
	__u32 size; /* size of register space */
	__u32 reg_id;
};

/* Use 'k' as magic number */
#define VDC_IOC_M  'k'

/*
 * S means "Set" through a ptr,
 * T means "Tell" directly with the argument value
 * G means "Get": reply by setting through a pointer
 * Q means "Query": response is on the return value
 * X means "eXchange": G and S atomically
 * H means "sHift": T and Q atomically
 */

#define HANTRODEC_PP_INSTANCE		_IO(VDC_IOC_M, 1)
#define HANTRODEC_HW_PERFORMANCE	_IO(VDC_IOC_M, 2)
#define HANTRODEC_IOCGHWOFFSET		_IOR(VDC_IOC_M,  3, unsigned long *)
#define HANTRODEC_IOCGHWIOSIZE		_IOR(VDC_IOC_M,  4, unsigned int *)

#define HANTRODEC_IOC_CLI		_IO(VDC_IOC_M,  5)
#define HANTRODEC_IOC_STI		_IO(VDC_IOC_M,  6)
#define HANTRODEC_IOC_MC_OFFSETS	_IOR(VDC_IOC_M, 7, unsigned long *)
#define HANTRODEC_IOC_MC_CORES		_IOR(VDC_IOC_M, 8, unsigned int *)


#define HANTRODEC_IOCS_DEC_PUSH_REG	_IOW(VDC_IOC_M, 9, struct core_desc *)
#define HANTRODEC_IOCS_PP_PUSH_REG	_IOW(VDC_IOC_M, 10, struct core_desc *)

#define HANTRODEC_IOCH_DEC_RESERVE	_IO(VDC_IOC_M, 11)
#define HANTRODEC_IOCT_DEC_RELEASE	_IO(VDC_IOC_M, 12)
#define HANTRODEC_IOCQ_PP_RESERVE	_IO(VDC_IOC_M, 13)
#define HANTRODEC_IOCT_PP_RELEASE	_IO(VDC_IOC_M, 14)

#define HANTRODEC_IOCX_DEC_WAIT		_IOWR(VDC_IOC_M, 15, struct core_desc *)
#define HANTRODEC_IOCX_PP_WAIT		_IOWR(VDC_IOC_M, 16, struct core_desc *)

#define HANTRODEC_IOCS_DEC_PULL_REG	_IOWR(VDC_IOC_M, 17, struct core_desc *)
#define HANTRODEC_IOCS_PP_PULL_REG	_IOWR(VDC_IOC_M, 18, struct core_desc *)

#define HANTRODEC_IOCG_CORE_WAIT	_IOR(VDC_IOC_M, 19, int *)

#define HANTRODEC_IOX_ASIC_ID		_IOWR(VDC_IOC_M, 20, __u32 *)

#define HANTRODEC_IOCG_CORE_ID		_IOR(VDC_IOC_M, 21, unsigned long)

#define HANTRODEC_IOCS_DEC_WRITE_REG	_IOW(VDC_IOC_M, 22, struct core_desc *)

#define HANTRODEC_IOCS_DEC_READ_REG	_IOWR(VDC_IOC_M, 23, struct core_desc *)

#define HANTRODEC_IOX_ASIC_BUILD_ID	_IOWR(VDC_IOC_M, 24, __u32 *)

#define HANTRODEC_IOCS_MMU_MEM_MAP	_IOWR(VDC_IOC_M, 25, struct addr_desc *)

#define HANTRODEC_IOCS_MMU_MEM_UNMAP	_IOWR(VDC_IOC_M, 26, struct addr_desc *)

#define HANTRODEC_IOCS_MMU_ENABLE	_IOWR(VDC_IOC_M, 27, unsigned int *)

#define HANTRODEC_DEBUG_STATUS		_IO(VDC_IOC_M, 29)

#define HANTRODEC_IOC_MAXNR 29

#endif /* !_HANTRODEC_H_ */
